package com.lbt.javaSE.Alog;

public class FindNumber {
    public static void main(String[] args) {
       // int matrix[][]=new int[][]{{1,22,3,4},{1,22,3,4},{1,5,3,4},{1,22,3,4}};
        int matrix[][]=new int[0][0];
        boolean result = findNumberIn2DArray(matrix, 155);
        System.out.println(result);
    }
    public static boolean findNumberIn2DArray(int[][] matrix, int target) {
        int row=matrix.length;
        if (row==0)return false;
        int X2=matrix[0].length;
        int X1=matrix.length;
        //数组遍历一遍查找 数据
        for(int i=0;i<X1;i++){
            for(int j=0;j<X2;j++){
                if(target==matrix[i][j]){
                    return true;
                }
            }
        }
        return false;
    }
}
